<!DOCTYPE html>
<html>
<head>
<title>Liste des clients connectés</title>
<meta charset="utf-8" HTTP-EQUIV="Refresh"
	CONTENT="8; URL=http://fr-d134685.groupinfra.com/showroom/iBeacon_project/iBeacon_project/web/vendeur_client_connecte.php">
<!-- Bootstrap -->
<link href="../css/bootstrap.min.css" rel="stylesheet" media="screen">
<!-- My style -->
<link href="../css/bootstrap.css" rel="stylesheet" media="screen">
<link href="../css/dashboard.css" rel="stylesheet">
</head>
<body>
	<div class="container">

		<div class="navbar navbar-default navbar-fixed-top" role="navigation">
			<div class="container">
				<div class="navbar-header">
					<a href="./vendeur_choix_service.php"> <img class="pull-left"
						src="../img/logo.png" width="125px" height="50px">
					</a>
					<button type="button" class="navbar-toggle" data-toggle="collapse"
						data-target=".navbar-collapse">
						<span class="sr-only">Toggle navigation</span> <span
							class="icon-bar"></span> <span class="icon-bar"></span> <span
							class="icon-bar"></span>
					</button>
					<a class="navbar-brand" href="#"><?php include './affichage_user.php'; ?></a>
				</div>
				<div class="collapse navbar-collapse">
					<ul class="nav navbar-nav">
						<li class="active"><a href="#tous" data-toggle="pill">Tous les
								clients connectés</a></li>
						<li><a href="#duree" data-toggle="pill">Cours de cuisine prévu</a></li>
						<li><a href="#depenses" data-toggle="pill">Client important</a></li>
						<li><a href="#localisation" data-toggle="pill">Localisation</a></li>
					</ul>
					<ul class="nav navbar-nav navbar-right">
						<li>
							<form name="zeform1" id="bouton"
								action="../action/deconnexionAction.php" method="post">
								<input id="deconnexion" name="deconnexion" type="hidden"
									value="Deconnexion" />
							</form> <a href="#nowhere" onClick="zeform1.submit();">Déconnexion</a>
						</li>
					</ul>
				</div>
				<!--/.nav-collapse -->
			</div>
		</div>

		<br /> <br /> <br />

		<!-- Banniere de trie -->
		<div class="modal-header">
			<!-- 			<ul class="nav nav-pills pull-right"> -->
			<!-- 				<li class="active"><a href="#duree" data-toggle="pill">Durée</a></li> -->
			<!-- 				<li><a href="#depenses" data-toggle="pill">Dépenses</a></li> -->
			<!-- 				<li><a href="#localisation" data-toggle="pill">Localisation</a></li> -->
			<!-- 			</ul> -->
			<h4>Liste des clients connectés</h4>
		</div>
		<div class="modal-body">
			<div class="row-fluid">
				<div class="tab-content">

					<div align="center" class="tab-pane" id="duree">
						<form>
							<fieldset>
								<div class="controls controls-row">
									<div class="controls controls-row">
										<select class="selectpicker">
											<option>Cours prévu dans</option>
											<option>Moins d'une heure</option>
											<option>Plus d'une heure</option>
										</select>
										<button type="submit" class="btn btn-warning">Trier</button>
									</div>
								</div>
							</fieldset>
						</form>
					</div>

					<div align="center" class="tab-pane" id="localisation">
						<form>
							<fieldset>
								<div class="controls controls-row">
									<select class="selectpicker">
										<option>Parking</option>
										<option>Cuisine</option>
										<option>Caisse</option>
										<option>Matériaux</option>
									</select>
									<button type="submit" class="btn btn-warning">Trier</button>
								</div>
							</fieldset>
						</form>
					</div>
				</div>
			</div>
		</div>

		<!-- Liste des clients -->
		<?php
		require_once ("../persistance/dao/ClientDAO.php");
		require_once ("../services/ResponsableService.php");
		require_once ("../bean/data/Client.php");
		
		$responsableService = new ResponsableService ();
		
		// session_start ();
		$_SESSION ['listClient'] = $responsableService->getListClient ();
		
		$listClient = $_SESSION ['listClient'];
		
		echo '<div';
		echo '			class="well col-xs-8 col-sm-8 col-md-8 col-lg-8 col-xs-offset-2 col-sm-offset-2 col-md-offset-2 col-lg-offset-2">';
		foreach ( $listClient as $client ) {
			
			echo '			<div class="row user-row">';
			echo '			<div class="col-xs-3 col-sm-2 col-md-1 col-lg-1">';
			echo '			<img class="img-circle"';
			echo '			src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=50"';
			echo '		alt="User Pic">';
			echo '				</div>';
			echo '			<div class="col-xs-8 col-sm-9 col-md-10 col-lg-10">';
			echo '			<strong>' . $client->getNomClient () . ' ' . $client->getPrenomClient () . '</strong><br> <span class="text-muted">Type';
			echo '			d\'utilisateur: ' . $client->getTypeClient () . '</span>';
			echo '				</div>';
			echo '			<div class="col-xs-1 col-sm-1 col-md-1 col-lg-1 dropdown-user"';
			echo '			data-for=".' . $client->getLoginClient () . '">';
			echo '			<i class="glyphicon glyphicon-chevron-down text-muted"></i>';
			echo '			</div>';
			echo '		</div>';
			echo '		<div class="row user-infos ' . $client->getLoginClient () . '">';
			echo '			<div';
			echo '				class="col-xs-12 col-sm-12 col-md-10 col-lg-10 col-xs-offset-0 col-sm-offset-0 col-md-offset-1 col-lg-offset-1">';
			echo '				<div class="panel panel-primary">';
			echo '					<div class="panel-heading">';
			echo '						<h3 class="panel-title">Informations client</h3>';
			echo '					</div>';
			echo '					<div class="panel-body">';
			echo '						<div class="row">';
			echo '						<div class="col-md-3 col-lg-3 hidden-xs hidden-sm">';
			echo '								<img class="img-circle"';
			echo '									src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=100"';
			echo '								alt="User Pic">';
			echo '						</div>';
			echo '							<div class="col-xs-2 col-sm-2 hidden-md hidden-lg">';
			echo '							<img class="img-circle"';
			echo '								src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=50"';
			echo '									alt="User Pic">';
			echo '							</div>';
			echo '							<div class="col-xs-10 col-sm-10 hidden-md hidden-lg">';
			echo '								<strong>' . $client->getNomClient () . ' ' . $client->getPrenomClient () . ' (' . $client->getLoginClient () . ')</strong><br>';
			echo '								<dl>';
			echo '								<dt>Type d\'utilisateur:</dt>';
			echo '									<dd>' . $client->getTypeClient () . '</dd>';
			echo '									<dt>Enregistré depuis:</dt>';
			echo '									<dd>' . $client->getDateInscription () . '</dd>';
			echo '									<dt>E-mail</dt>';
			echo '									<dd>' . $client->getEmailClient () . '</dd>';
			echo '									<dt>Téléphone</dt>';
			echo '									<dd>' . $client->getTelClient () . '</dd>';
			echo '									<dt>Nombre de viste par mois</dt>';
			echo '									<dd>' . $client->getNbVisites () . '</dd>';
			echo '							</dl>';
			echo '							</div>';
			echo '						<div class=" col-md-9 col-lg-9 hidden-xs hidden-sm">';
			echo '							<strong>' . $client->getNomClient () . ' ' . $client->getPrenomClient () . ' (' . $client->getLoginClient () . ')</strong><br>';
			echo '								<table class="table table-user-information">';
			echo '								<tbody>';
			echo '									<tr>';
			echo '										<td>Type d\'utilisateur:</td>';
			echo '											<td>' . $client->getTypeClient () . '</td>';
			echo '									</tr>';
			echo '										<tr>';
			echo '											<td>Enregistré depuis:</td>';
			echo '											<td>' . $client->getDateInscription () . '</td>';
			echo '										</tr>';
			echo '										<tr>';
			echo '											<td>E-mail</td>';
			echo '											<td>' . $client->getEmailClient () . '</td>';
			echo '										</tr>';
			echo '										<tr>';
			echo '											<td>Téléphone</td>';
			echo '											<td>' . $client->getTelClient () . '</td>';
			echo '										</tr>';
			echo '										<tr>';
			echo '											<td>Nombre de viste par mois</td>';
			echo '											<td>' . $client->getNbVisites () . '</td>';
			echo '										</tr>';
			echo '									</tbody>';
			echo '								</table>';
			echo '							</div>';
			echo '						</div>';
			echo '					</div>';
			echo '					<div class="panel-footer">';
			echo '						<a href="./vendeur_page_promo.php?numClient=' . $client->getNumClient () . '"><button class="btn btn-block btn-danger" type="button"';
			echo '							data-toggle="tooltip"';
			echo '							data-original-title="Envoi d\'une promo au client" >';
			echo '							<i class="glyphicon glyphicon-envelope"></i>';
			echo '						</button></a>';
			echo '					</div>';
			echo '				</div>';
			echo '			</div>';
			echo '		</div>';
		}
		echo '	</div>';
		echo '	</div>';
		
		?>
		
		
		
	</div>

</body>
<footer>
	<script src="http://code.jquery.com/jquery.js"></script>
	<script src="../js/bootstrap.js"></script>

	<script>
		$(document)
				.ready(
						function() {
							var panels = $('.user-infos');
							var panelsButton = $('.dropdown-user');
							panels.hide();

							//Click dropdown
							panelsButton
									.click(function() {
										//get data-for attribute
										var dataFor = $(this).attr('data-for');
										var idFor = $(dataFor);

										//current button
										var currentButton = $(this);
										idFor
												.slideToggle(
														400,
														function() {
															//Completed slidetoggle
															if (idFor
																	.is(':visible')) {
																currentButton
																		.html('<i class="glyphicon glyphicon-chevron-up text-muted"></i>');
															} else {
																currentButton
																		.html('<i class="glyphicon glyphicon-chevron-down text-muted"></i>');
															}
														})
									});

							$('[data-toggle="tooltip"]').tooltip();
						});
	</script>

</footer>
</html>